﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChongZhi.aspx.cs" Inherits="Joyintech.Web.inpiao365.PhenixTicket.ChongZhi" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script src="/js/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">

        function Changelable(num, value) {
            if (value != isNaN) {
                $("#pay" + num).html(value);
                var o = parseInt(0) + parseInt(value);
                $("#payover" + num).html(o);
            }

            if (value == "") {
                o = parseInt(0);
                $("#payover" + num).html(o);
            }
        }

        function MoneyOnKeyup() {
            if ($("#txt1").val() != "")
                Changelable(1, $("#txt1").val());
            else
                Changelable(1, 0);
        }

        function MoneyOnBlur() {
           
            var input = $(this);

            var v = input.val();
            if (v != "") {
                var reg = new RegExp("^[0-9]*[1-9][0-9]*$");
                if (!reg.test(v)) {
                    alert("请填入整数");
                    input.val("");
                    Changelable(1, 0);
                    return false;
                }

                $("#txt1").attr("value", (($("#txt1").val() * 100) / 100));
                Changelable(1, $("#txt1").val());
            }
            else if (v == "0") {
                input.val("");
                Changelable(1, 0);
            }
        }
                    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
  请输入充值金额:<input type="text" class="u_text" id="txt1" onkeyup="MoneyOnKeyup()" onblur="MoneyOnBlur()" runat="server" />元
                    <asp:ImageButton ID="btnPay" 
            ImageUrl="/UserCenter/images/nextbtn.jpg" style="border-width:0px;"  
            runat="server" onclick="btnPay_Click" /></div>
    </form>
</body>
</html>
